<?php
class Inspiration extends AppModel {
	var $name = 'Inspiration';
	var $validate = array(
		'subcategory_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'text' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'allowEmpty' => false,
				'message' => 'Please insert text of your inpiration..',
			),
			'notdefault' => array(
				'rule' => 'validateNotDefault',
				'message' => 'Please insert text of your inpiration..')
		),

	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Subcategory' => array(
			'className' => 'Subcategory',
			'foreignKey' => 'subcategory_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	function validateNotDefault($value){
		if ($value =='First write something in here to inspire others! It could be some idea, input or link for category below, that you find interesting, motivating or just cheers you up!'){
			$valid=true;
		}
	}
}
